#include <aphw/Flags.hpp>

#include <boost/python.hpp>
#include <ham/hamsterdb.h>

using namespace boost::python;

namespace
{

enum Flags
{
    AUTO_CLEANUP = HAM_AUTO_CLEANUP,
    CACHE_STRICT = HAM_CACHE_STRICT,
    DISABLE_MMAP = HAM_DISABLE_MMAP,
    DISABLE_VAR_KEYLEN = HAM_DISABLE_VAR_KEYLEN,
    DUPLICATE = HAM_DUPLICATE,
    ENABLE_DUPLICATES = HAM_ENABLE_DUPLICATES,
    ENABLE_RECOVERY = HAM_ENABLE_RECOVERY,
    ENABLE_TRANSACTIONS = HAM_ENABLE_TRANSACTIONS,
    IN_MEMORY_DB = HAM_IN_MEMORY_DB,
    OVERWRITE = HAM_OVERWRITE,
    PARTIAL = HAM_PARTIAL,
    READ_ONLY = HAM_READ_ONLY,
    RECORD_NUMBER = HAM_RECORD_NUMBER,
    TXN_READ_ONLY = HAM_TXN_READ_ONLY,
    TXN_AUTO_COMMIT = HAM_TXN_AUTO_COMMIT,
    TXN_AUTO_ABORT = HAM_TXN_AUTO_ABORT,
    USE_BTREE = HAM_USE_BTREE,
    WRITE_THROUGH = HAM_WRITE_THROUGH
};

}

namespace aphw
{

void init_Flags()
{
    enum_< ::Flags >("Flags")
        .value("AUTO_CLEANUP", ::AUTO_CLEANUP)
        .value("CACHE_STRICT", ::CACHE_STRICT)
        .value("DISABLE_MMAP", ::DISABLE_MMAP)
        .value("DISABLE_VAR_KEYLEN", ::DISABLE_VAR_KEYLEN)
        .value("DUPLICATE", ::DUPLICATE)
        .value("ENABLE_DUPLICATES", ::ENABLE_DUPLICATES)
        .value("ENABLE_RECOVERY", ::ENABLE_RECOVERY)
        .value("ENABLE_TRANSACTIONS", ::ENABLE_TRANSACTIONS)
        .value("IN_MEMORY_DB", ::IN_MEMORY_DB)
        .value("OVERWRITE", ::OVERWRITE)
        .value("PARTIAL", ::PARTIAL)
        .value("READ_ONLY", ::READ_ONLY)
        .value("RECORD_NUMBER", ::RECORD_NUMBER)
        .value("TXN_READ_ONLY", ::TXN_READ_ONLY)
        .value("TXN_AUTO_COMMIT", ::TXN_AUTO_COMMIT)
        .value("TXN_AUTO_ABORT", ::TXN_AUTO_ABORT)
        .value("USE_BTREE", ::USE_BTREE)
        .value("WRITE_THROUGH", ::WRITE_THROUGH)
        ;
}

}
